/**
 * @(#)AdminServiceImpl.java, 2020/8/3.
 * <p/>
 * Copyright 2020 Netease, Inc. All rights reserved.
 * NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.lhh.myspringboot.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lhh.myspringboot.bean.Admin;
import com.lhh.myspringboot.dao.AdminDao;
import com.lhh.myspringboot.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lvhouhou(lvhouhou @ 163.com)
 */

@Service
public class AdminServiceImpl implements AdminService {


    @Autowired
    private AdminDao adminDao;

    @Override
    public Admin getAdmin(String id) {
        return null;
    }

    @Override
    public void register(Admin admin) {
        adminDao.register(admin);
    }

    @Override
    public PageInfo<Admin> getAdminList(int page, int size) {
        PageHelper.startPage(page, size);
        List<Admin> adminList = adminDao.getAdminList();
        PageInfo<Admin> adminPageInfo = new PageInfo<>(adminList);
        return adminPageInfo;
    }
}
